
from enum import Enum, unique


@unique
class ports(Enum):
    '''
    用户角色
    '''

    # 企业
    Enterprise = "21,22,23,25,53,U:53,80,81,110,111,123,U:123,135,U:137,139,U:161,389,443,445,465,500,515,U:520,U:523,548,623,636,873,902,1080,1099,1433,1521,U:1604,U:1645,U:1701,1883,U:1900,2049,2181,2375,2379,4430,U:2425,3128,3306,3389,4730,U:5060,5222,U:5351,U:5353,5432,5555,5601,5672,U:5683,5900,5938,5984,6000,6379,7001,7077,8080,8081,8443,8545,8686,9000,9042,9092,9100,9200,9418,9999,11211,27017,37777,50000,50070,61616"
    # 精简端口
    Minimal = "21,22,80,U:137,U:161,443,445,U:1900,3306,3389,U:5353,8080"
    # 咖啡厅 / 酒店 / 机场
    Coffee_Bar_Hotel_Airport = "21,22,23,25,U:53,80,110,111,135,U:137,139,U:161,389,443,445,515,548,873,902,1080,1433,U:1900,2181,2375,2379,3128,3306,3389,U:5060,5222,U:5351,U:5353,5555,5672,U:5683,5900,6379,7001,8080,9000,9100,9200,11211"
    # 数据库
    Database = "1433,1521,1583,2100,2049,3050,3306,3351,5000,5432,5433,5601,5984,6082,6379,7474,8080,8088,8089,8098,8471,9000,9160,9200,9300,9471,11211,15672,19888,27017,27019,27080,28017,50000,50070,50090"
    # 常用端口
    General = "1,7,9,13,19,21-23,25,37,42,49,53,69,79-81,85,105,109-111,113,123,135,137-139,143,161,179,222,264,384,389,402,407,443-446,465,500,502,512-515,523-524,540,548,554,587,617,623,689,705,771,783,873,888,902,910,912,921,993,995,998,1000,1024,1030,1035,1090,1098-1103,1128-1129,1158,1199,1211,1220,1234,1241,1300,1311,1352,1433-1435,1440,1494,1521,1530,1533,1581-1582,1604,1720,1723,1755,1811,1900,2000-2001,2049,2082,2083,2100,2103,2121,2199,2207,2222,2323,2362,2375,2380-2381,2525,2533,2598,2601,2604,2638,2809,2947,2967,3000,3037,3050,3057,3128,3200,3217,3273,3299,3306,3311,3312,3389,3460,3500,3628,3632,3690,3780,3790,3817,4000,4322,4433,4444-4445,4659,4679,4848,5000,5038,5040,5051,5060-5061,5093,5168,5247,5250,5351,5353,5355,5400,5405,5432-5433,5498,5520-5521,5554-5555,5560,5580,5601,5631-5632,5666,5800,5814,5900-5910,5920,5984-5986,6000,6050,6060,6070,6080,6082,6101,6106,6112,6262,6379,6405,6502-6504,6542,6660-6661,6667,6905,6988,7001,7021,7071,7080,7144,7181,7210,7443,7510,7579-7580,7700,7770,7777-7778,7787,7800-7801,7879,7902,8000-8001,8008,8014,8020,8023,8028,8030,8080-8082,8087,8090,8095,8161,8180,8205,8222,8300,8303,8333,8400,8443-8444,8503,8800,8812,8834,8880,8888-8890,8899,8901-8903,9000,9002,9060,9080-9081,9084,9090,9099-9100,9111,9152,9200,9390-9391,9443,9495,9809-9815,9855,9999-10001,10008,10050-10051,10080,10098,10162,10202-10203,10443,10616,10628,11000,11099,11211,11234,11333,12174,12203,12221,12345,12397,12401,13364,13500,13838,14330,15200,16102,17185,17200,18881,19300,19810,20010,20031,20034,20101,20111,20171,20222,22222,23472,23791,23943,25000,25025,26000,26122,27000,27017,27888,28222,28784,30000,30718,31001,31099,32764,32913,34205,34443,37718,38080,38292,40007,41025,41080,41523-41524,44334,44818,45230,46823-46824,47001-47002,48899,49152,50000-50004,50013,50500-50504,52302,55553,57772,62078,62514,65535"

    SCADA_ICS = "21,22,23,80,102,U:161,443,502,1089-1091,U:2222,4000,U:4000,4840,20000,U:20000,U:47808,34962-34964,U:34980,44818,U:44818,U:55000-55003"
    # 物联网
    IoT = "21,22,23,25,80,81,82,83,84,88,137,143,443,445,554,631,1080,1883,1900,2000,2323,4433,4443,4567,5222,5683,7474,7547,8000,8023,8080,8081,8443,8088,8883,8888,9000,9090,9999,10000,37777,49152"
    # 后门
    Backdoor_Check = "50050"
    # 所有端口
    ALL_Ports = "7,11,13,17,19,21,22,23,25,26,37,43,49,U:53,53,67,U:69,U:69,70,79,80,81,81,82,82,83,84,88,102,102,104,110,111,113,U:113,113,119,U:123,U:123,135,U:137,138,139,143,U:161,U:162,175,179,199,264,264,389,U:391,443,443,443,444,445,465,465,500,U:500,U:500,502,503,512,515,U:520,U:523,548,554,564,587,U:623,U:626,631,636,U:705,771,789,873,880,902,992,993,995,1025,1025,1025,1025,1025,1026,1026,1027,U:1027,1080,1080,1099,1177,1194,U:1194,1200,1201,1234,1241,1260,1311,1344,1433,U:1434,1471,1521,U:1604,U:1645,U:1701,1723,U:1812,1863,1883,U:1900,1911,1962,1967,1991,U:1993,2000,2000,2000,2001,2080,2082,2083,2086,2087,U:2094,2121,U:2123,U:2152,2181,2222,2222,2222,2323,2332,2375,2375,2376,2376,2379,2401,2404,2424,U:2424,U:2425,U:2427,2455,2480,2501,2628,3000,3128,3260,3260,U:3283,3288,3299,3306,3307,3310,3333,U:3333,3388,3389,3390,3460,3541,3542,U:3671,3689,U:3702,3749,3780,U:3784,4000,4022,4040,4063,4064,U:4070,4369,4369,4443,4444,4567,4712,4730,4786,U:4800,4840,4848,4880,4911,4949,5000,5001,5006,U:5006,5007,5009,5050,U:5060,U:5093,U:5094,5222,5269,U:5351,U:5353,5357,5400,5432,U:5554,5555,5555,5555,5560,5577,U:5632,5672,5678,U:5683,5900,5901,5938,5984,5985,5986,5986,6000,6000,6001,6379,6488,6664,6665,6666,6666,6667,6668,6669,U:6881,U:6969,7000,7000,7001,7001,7071,7077,7288,7474,7547,7548,7634,7777,7779,7911,8000,8000,8000,8000,8001,8008,8009,8009,8010,8060,8069,8080,8081,8086,8087,8089,8090,8098,8099,8112,8125,8126,8139,8161,8200,8291,8333,8334,8377,8378,8443,8443,8545,8554,8649,8686,8800,8834,8880,U:8888,8888,8888,8889,9000,9000,9000,9003,9010,9042,9051,9080,9100,9100,9100,9151,9191,9200,9333,9418,9443,9595,U:9600,9653,9653,9700,9711,9944,9981,9999,9999,10000,10000,U:10001,10001,10001,10162,10243,10333,11001,11001,11211,11300,11310,11310,12345,13579,14000,14147,14265,16010,16992,16993,U:17185,18001,18081,18245,18245,18245,20000,U:20000,20547,22105,22222,23023,23424,25105,25565,U:27015,27015,27017,28017,U:28784,U:30310,U:30311,U:30312,U:30313,U:30718,32400,U:32768,33338,U:34962,U:34964,37777,U:44818,45554,U:47808,U:48899,49151,49152,49153,49154,49155,50000,50050,50070,50100,51106,55553,U:59110,61613,61616,62078,64738"


@unique
class vul_type(Enum):
    '''
    漏洞类型
    '''

    General_PoC = '0'
    Brute_Force = '1'
    All = '2'
    Empty = '3'


@unique
class portscanmode(Enum):
    '''
    扫描模式
    '''

    Assets_first = 0  # 资产优先
    Simultaneously = 1  # 同时扫描


@unique
class parent_category(Enum):
    '''
    分类
    '''

    Support_System = 'Support System'
    Software_System = 'Software_System'
    Enterprise_Application = 'Enterprise Application'
    Network_Device = 'Network Device'
    Network_Security = 'Network Security'
